class HostDict:
    _dict = {}

    @classmethod
    def get_by_name(cls, name):
        if cls._dict[name]:
            return cls._dict[name]

    @classmethod
    def get_by_names(cls, names: list):
        if not names:
            return
        res_list = []
        for name in names:
            if cls._dict[name]:
                res_list.append(cls._dict[name])
        return res_list

    @classmethod
    def write(cls, _dict: dict):
        cls._dict = _dict
